﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using ZeroSum.Domain.Entities;

namespace ZeroSum.Plugin.Authorization.Datas.Aggregates.RoleAggregate;

public class RoleBase : BaseEntity<long>, ISoftDelete
{
    /// <summary>
    ///     名称
    /// </summary>
    [DisplayName("角色名称")]
    [Required]
    [MaxLength(20)]
    public virtual string? Name { get; set; }

    [DisplayName("标准化角色名称")]
    [Required]
    [MaxLength(20)]
    public virtual string? NormalizeCode { get; set; }

    /// <summary>
    ///     编码
    /// </summary>
    [DisplayName("编码")]
    [Required]
    [MaxLength(50)]
    public virtual string? Code { get; set; }

    /// <summary>
    ///     排序
    /// </summary>
    [DisplayName("排序")]
    public virtual int Sort { get; set; }

    /// <summary>
    ///     备注
    /// </summary>
    [DisplayName("备注")]
    [MaxLength(100)]
    public virtual string? Remark { get; set; }

    public bool IsDeleted { get; set; }

    public override string ToString()
    {
        return Name!;
    }
}